<!--container begin-->

<div id="container" class="fix">
  <div id="main">
    <div class="crumb"> <a href="#">Home</a> &gt;
      <?php 
			
					if($cate_p['cateurl'] != $cate_c['cateurl']){
					
						echo '<a href="/'.$cate_p['cateurl'].'">'.$cate_p['catename'].'</a>';
						
						echo '&gt;'.$cate_c['catename'];
					
					}else{
						
						echo $cate_p['catename'];

					}
			
			?>
    </div>
    <div class="categoryBar">
      <h1><?php echo $cate_p['catename'];?></h1>
      <div class="page">
        <?php if($curr_page>1):?>
        <a href="/<?php echo $cate_p['cateurl'];?>/<?php echo $curr_page-1;?>" rel="nofollow" class="pre"></a>
        <?php endif;?>
        <?php 

	if($total_pages>10){
	
		if($curr_page>4){
			
			echo '<a href="/'.$cate_p['cateurl'].'/';
			
			if($cate_p['cateurl'] != $cate_c['cateurl']){

				echo $cate_c['cateurl'].'/';		

			}

			echo '1">1</a>&nbsp;';
			
			echo '<a href="#">...</a>&nbsp;';
			
			if($curr_page+3<$total_pages){
				
				for ($i=$curr_page-3;$i<=$curr_page+3;$i++){
					
					if ($i == $curr_page) {
							
						echo '<span>['.$i.']</span>';
							
						continue;
					
					}
						
					echo '<a href="/'.$cate_p['cateurl'].'/';
					
					if($cate_p['cateurl'] != $cate_c['cateurl']){
					
						echo $cate_c['cateurl'].'/';
					
					}
					
					echo $i.'">'.$i.'</a>&nbsp;';
					
				}
				
				echo '<a href="#">...</a>&nbsp;';
				
				echo '<a href="/'.$cate_p['cateurl'].'/';
					
				if($cate_p['cateurl'] != $cate_c['cateurl']){
				
					echo $cate_c['cateurl'].'/';
				
				}
				
				echo $total_pages.'">'.$total_pages.'</a>&nbsp;';
				
			}else{
				
				for ($i=$curr_page-3;$i<=$total_pages;$i++){
					
					if ($i == $curr_page) {
							
						echo '<span>['.$i.']</span>';
							
						continue;
							
					}
					
					echo '<a href="/'.$cate_p['cateurl'].'/';
						
					if($cate_p['cateurl'] != $cate_c['cateurl']){
							
						echo $cate_c['cateurl'].'/';
							
					}
						
					echo $i.'">'.$i.'</a>&nbsp;';
					
				}
				
			}

		}else{
			
			for ($i=1;$i<=$curr_page+3;$i++){

				if ($i == $curr_page) {
					
					echo '<span>['.$i.']</span>';
					
					continue;

				}
			
				echo '<a href="/'.$cate_p['cateurl'].'/';
	
				if($cate_p['cateurl'] != $cate_c['cateurl']){
				
					echo $cate_c['cateurl'].'/';
				
				}
				
				echo $i.'">'.$i.'</a>&nbsp;';
	
			}
			
			echo '<a href="#">...</a>&nbsp;';
			
			echo '<a href="/'.$cate_p['cateurl'].'/';
			
			if($cate_p['cateurl'] != $cate_c['cateurl']){

				echo $cate_c['cateurl'].'/';		

			}

			echo $total_pages.'">'.$total_pages.'</a>&nbsp;'; 

		}

	}else{
		
		for($i = 1;$i<=$total_pages;$i++){
			
			echo '<a href="/'.$cate_p['cateurl'].'/';

			if($cate_p['cateurl'] != $cate_c['cateurl']){
					
				echo $cate_c['cateurl'].'/';
					
			}
			
			echo $i.'">'.$i.'</a>&nbsp;';

		}

	}
	
	
	
?>
        <?php if(($curr_page+1)<=$total_pages):?>
        <a class="next" href="/<?php echo $cate_p['cateurl'];?>/<?php echo $curr_page+1;?>" rel="nofollow"></a> &nbsp;
        <?php endif;?>
      </div>
    </div>
    <div class="collection" style=" float:left; width:100%;margin:10px 0 0 0; border:1px solid #313131; background: #231F20">
        <ul style="float:left;width:100%;">
          <?php foreach ($childcates as $item):?>
          <li style="float:left; width:30%; margin-left:3%"> <a href="/<?php echo $item['cateurl'];?>"><?php echo $item['catename']?></a> </li>
          <?php endforeach;?>
        </ul>
      </div>
    <div class="list">
      <ul>
        <?php foreach ($product_list as $key =>$item):?>
        <li class="box" onmouseover="changeStyle(this);"
					onmouseout="changeStyle(this);">
            <div class="pic"> <a href="/<?php echo $item['product_url']?>"> <img src="<?php echo $item['product_images']?>" width="180px" height="180px" alt="" /> </a> </div>
          <div class="name"> <a href="/<?php echo $item['product_url']?>" title=""><?php echo $item['product_name']?></a> </div>
          <p class="retail">Regular Price:<?php echo $symbol.ceil($item['product_oprice']*100)/100?></p>
          <p class="was"> Was: <del><?php echo $symbol.ceil($item['product_oprice']*0.8*100)/100?> </del> </p>
          <p class="now">Now: <?php echo $symbol.ceil($item['product_price']*100)/100?></p>
        </li>
        <?php endforeach;?>
      </ul>
    </div>
    <div class="categoryBar mt10">
      <div class="page">
        <?php if($curr_page>1):?>
        <a href="/<?php echo $cate_p['cateurl'];?>/<?php echo $curr_page-1;?>" rel="nofollow" class="pre"></a>
        <?php endif;?>
        <?php 

	if($total_pages>10){
	
		if($curr_page>4){
			
			echo '<a href="/'.$cate_p['cateurl'].'/';
			
			if($cate_p['cateurl'] != $cate_c['cateurl']){

				echo $cate_c['cateurl'].'/';		

			}

			echo '1">1</a>&nbsp;';
			
			echo '<a href="#">...</a>&nbsp;';
			
			if($curr_page+3<$total_pages){
				
				for ($i=$curr_page-3;$i<=$curr_page+3;$i++){
					
					if ($i == $curr_page) {
							
						echo '<span>['.$i.']</span>';
							
						continue;
					
					}
						
					echo '<a href="/'.$cate_p['cateurl'].'/';
					
					if($cate_p['cateurl'] != $cate_c['cateurl']){
					
						echo $cate_c['cateurl'].'/';
					
					}
					
					echo $i.'">'.$i.'</a>&nbsp;';
					
				}
				
				echo '<a href="#">...</a>&nbsp;';
				
				echo '<a href="/'.$cate_p['cateurl'].'/';
					
				if($cate_p['cateurl'] != $cate_c['cateurl']){
				
					echo $cate_c['cateurl'].'/';
				
				}
				
				echo $total_pages.'">'.$total_pages.'</a>&nbsp;';
				
			}else{
				
				for ($i=$curr_page-3;$i<=$total_pages;$i++){
					
					if ($i == $curr_page) {
							
						echo '<span>['.$i.']</span>';
							
						continue;
							
					}
					
					echo '<a href="/'.$cate_p['cateurl'].'/';
						
					if($cate_p['cateurl'] != $cate_c['cateurl']){
							
						echo $cate_c['cateurl'].'/';
							
					}
						
					echo $i.'">'.$i.'</a>&nbsp;';
					
				}
				
			}

		}else{
			
			for ($i=1;$i<=$curr_page+3;$i++){

				if ($i == $curr_page) {
					
					echo '<span>['.$i.']</span>';
					
					continue;

				}
			
				echo '<a href="/'.$cate_p['cateurl'].'/';
	
				if($cate_p['cateurl'] != $cate_c['cateurl']){
				
					echo $cate_c['cateurl'].'/';
				
				}
				
				echo $i.'">'.$i.'</a>&nbsp;';
	
			}
			
			echo '<a href="#">...</a>&nbsp;';
			
			echo '<a href="/'.$cate_p['cateurl'].'/';
			
			if($cate_p['cateurl'] != $cate_c['cateurl']){

				echo $cate_c['cateurl'].'/';		

			}

			echo $total_pages.'">'.$total_pages.'</a>&nbsp;'; 

		}

	}
	
	
?>
        <?php if(($curr_page+1)<=$total_pages):?>
        <a class="next" href="/<?php echo $cate_p['cateurl'];?>/<?php echo $curr_page+1;?>" rel="nofollow"></a> &nbsp;
        <?php endif;?>
      </div>
    </div>
  </div>
  <div id="aside">
    <ul>
      <li class="first"></li>
      <?php foreach ($categorys as $item):?>
      <li> <a href="/<?php echo $item['cateurl']?>"><?php echo $item['catename']?></a> </li>
      <?php endforeach;?>
      <li class="last"></li>
    </ul>
  </div>
</div>
<!--container end-->
